package com.mrd.annotation.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * Created by dengdc on 2016/10/25.
 */
public class NotNullValidator implements ConstraintValidator<MRDRequired, Object> {
    @Override
    public void initialize(MRDRequired constraintAnnotation) {
//        System.out.println("initialize");
    }

    @Override
    public boolean isValid(Object value, ConstraintValidatorContext context) {
//        System.out.println("isValid");
        return value != null;
    }
}
